function checkform()
{
  // see http://www.thesitewizard.com/archive/validation.shtml
  // for an explanation of this script and how to use it on your
  // own website
avat = encodeURIComponent(document.getElementById("avatar").value);
  // ** START **
  name = add.elements["avatar"].value;
  
  if (name.indexOf("jpg") == -1) {
    alert( "link avatar khong hop le" );
    return false ;
  }
  // ** END **
  return true ;
}